package cn.itrigger.dynamic.sql.condition;

import cn.itrigger.dynamic.sql.select.SelectModel;
import cn.itrigger.dynamic.sql.util.Buildable;

/**
 * @author admin
 * @date 2018/9/25
 **/
public abstract class AbstractSubselectCondition<T> implements VisitableCondition<T> {

    private SelectModel selectModel;

    protected AbstractSubselectCondition(Buildable<SelectModel> selectModelBuilder) {
        this.selectModel = selectModelBuilder.build();
    }

    public SelectModel getSelectModel() {
        return selectModel;
    }

    @Override
    public <R> R accept(ConditionVisitor<T, R> visitor) {
        return visitor.visit(this);
    }

    public abstract String renderCondition(String columnName, String renderedSelectStatement);
}
